<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户输入一个数字，在控制台中列出它的所有约数</title>
</head>
<body>
    <script>
        var n = prompt('input a number');
        for (var i = 1 ; i < n ; i++) {
            if (n % i === 0) {
                console.log(i)
            }
        }
    </script>
</body>
</html>